The present techniques relate to detecting logical relationships in databases. More specifically, the techniques relate to detecting logical relationships in databases based on structured query statements.